<script lang="ts" setup>
import IconSvg from "@/components/icon-svg.vue";
import { routes } from "@/router";

const poc = routes.find((r) => r.name === "poc");
</script>

<template>
  <div class="home">
    <router-link v-for="r in poc?.children" :key="r.name" :to="{ name: r.name }">
      <span class="project">
        <IconSvg v-if="r.meta?.icon" :name="r.meta.icon + ''" />
        {{ r.meta?.title || "未知路由" }}
      </span>
    </router-link>
  </div>
</template>

<style lang="scss" scoped>
@keyframes blink {
  0% {
    background-position: 0% 0%;
  }

  100% {
    background-position: 100% 100%;
  }
}

.home {
  display: flex;
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  animation: blink 30s infinite linear;
  background-image: url("@/assets/images/background.png");
  background-size: 50% 50%;
  height: 100vh;

  a {
    background-image: linear-gradient(#e7bf80, #a36506);
    -webkit-background-clip: text;
    -moz-background-clip: text;
    min-width: 10rem;
    color: transparent;
    font-size: large;
    text-decoration: none;

    .project {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
    }
  }
}
</style>
